{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c4371839",
   "metadata": {},
   "source": [
    "## Work 1 \n",
    "> 1. 使用help查看字典的其他方法\n",
    "> 2. 尝试每一种方法的使用并实践\n",
    "> 3. 请大家用表格记录每一种方法的如何使用、注意事项、使用结果"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a0235f09",
   "metadata": {},
   "source": [
    "### Work1.1 & 1.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a3d70bad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stu2001': 'xiaohong', 'stu2002': 'xiaoming', 'stu2003': 'xiaoli'}"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_info = {\n",
    "    \"stu2001\" : \"xiaohong\",\n",
    "    \"stu2002\" : \"xiaoming\",\n",
    "    \"stu2003\" : \"xiaoli\"\n",
    "}\n",
    "stu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "5c2dca9f",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function clear:\n",
      "\n",
      "clear(...) method of builtins.dict instance\n",
      "    D.clear() -> None.  Remove all items from D.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.clear ==> 清空字典里面的 k & v\n",
    "help(stu_info.clear)\n",
    "\n",
    "stu_info.clear()\n",
    "stu_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "c22dc209",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function copy:\n",
      "\n",
      "copy(...) method of builtins.dict instance\n",
      "    D.copy() -> a shallow copy of D\n",
      "\n",
      "{'stu2001': 'xiaohong', 'stu2002': 'xiaoming', 'stu2003': 'xiaoli'}\n",
      "{'stu2001': 'xiaozhang', 'stu2002': 'xiaoming', 'stu2003': 'xiaoli'}\n"
     ]
    }
   ],
   "source": [
    "# D.copy ==> 对字典进行浅复制  （https://www.runoob.com/python3/python3-att-dictionary-copy.html）\n",
    "help(stu_info.copy)\n",
    "\n",
    "stu_info = {\n",
    "    \"stu2001\" : \"xiaohong\",\n",
    "    \"stu2002\" : \"xiaoming\",\n",
    "    \"stu2003\" : \"xiaoli\"\n",
    "}\n",
    "dict1 = stu_info.copy()\n",
    "\n",
    "# 区分【赋值】和 【复制】 之间的不同\n",
    "\n",
    "dict2 = stu_info\n",
    "\n",
    "# 修改字典数据\n",
    "\n",
    "stu_info['stu2001'] = 'xiaozhang'\n",
    "\n",
    "print(dict1)\n",
    "print(dict2)\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "7e430d53",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function fromkeys:\n",
      "\n",
      "fromkeys(iterable, value=None, /) method of builtins.type instance\n",
      "    Create a new dictionary with keys from iterable and values set to value.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'stu2001': 123456, 'stu2002': 123456, 'stu2003': 123456}"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.fromkeys == > 初始化字典的所有值\n",
    "help(stu_info.fromkeys)\n",
    "\n",
    "stu_password = { }\n",
    "stu_password = stu_password.fromkeys([\"stu2001\",\"stu2002\",\"stu2003\"],123456)\n",
    "stu_password\n",
    "\n",
    "\n",
    "# vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "# word = input(\"Provid a word to search for vowels: \")\n",
    "# found = {}\n",
    "\n",
    "# # 初始化字典 字典的进阶方法\n",
    "# found = found.fromkeys(vowels,0)\n",
    "# for i in word:\n",
    "#     if i in vowels:\n",
    "#         found[i] +=1\n",
    "# found\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "bcea7396",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function get:\n",
      "\n",
      "get(key, default=None, /) method of builtins.dict instance\n",
      "    Return the value for key if key is in the dictionary, else default.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# D.get ==> 字典的取值  \n",
    "# 当 get 到字典中不存在的值时 不会报错！！！\n",
    "help(stu_info.get)\n",
    "\n",
    "stu_info.get(\"stu2001\")\n",
    "stu_info.get('stu2006')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "899693b2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function items:\n",
      "\n",
      "items(...) method of builtins.dict instance\n",
      "    D.items() -> a set-like object providing a view on D's items\n",
      "\n",
      "2001 xiaohong\n",
      "2002 xiaoming\n",
      "2003 xiaoli\n"
     ]
    }
   ],
   "source": [
    "# D.items ==> 字典的循环遍历\n",
    "#循环遍历的最大用途就是：给所有的值使用同样的 操作/方法\n",
    "help(stu_info.items)\n",
    "\n",
    "stu_info = {\n",
    "    \"stu2001\" : \"xiaohong\",\n",
    "    \"stu2002\" : \"xiaoming\",\n",
    "    \"stu2003\" : \"xiaoli\"\n",
    "}\n",
    "stu_info\n",
    "stu_names_list = [ ]\n",
    "for k,v in stu_info.items():\n",
    "    print(k[3:],v)\n",
    "    stu_names_list.append(k[3:])\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "bd2f713d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function keys:\n",
      "\n",
      "keys(...) method of builtins.dict instance\n",
      "    D.keys() -> a set-like object providing a view on D's keys\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['stu2001', 'stu2002', 'stu2003']"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.keys ==> 以 列表 的形式返回一个字典的所有 键 \n",
    "help(stu_info.keys)\n",
    "list(stu_info.keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "7749d53e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function pop:\n",
      "\n",
      "pop(...) method of builtins.dict instance\n",
      "    D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n",
      "    If key is not found, d is returned if given, otherwise KeyError is raised\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'xiaoli'"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.pop ==> 删除字典的 k & v，（）括号里面 必须填 k 【指定键删除】\n",
    "help(stu_info.pop)\n",
    "stu_info.pop(\"stu2003\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "b3d275ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function popitem:\n",
      "\n",
      "popitem() method of builtins.dict instance\n",
      "    Remove and return a (key, value) pair as a 2-tuple.\n",
      "    \n",
      "    Pairs are returned in LIFO (last-in, first-out) order.\n",
      "    Raises KeyError if the dict is empty.\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('stu2002', 'xiaoming')"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.popitem ==> 不同于D.pop() D.popitem()括号内可以不填内容 起到【随机删除】的作用\n",
    "help(stu_info.popitem)\n",
    "stu_info.popitem()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "5d3cf271",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function setdefault:\n",
      "\n",
      "setdefault(key, default=None, /) method of builtins.dict instance\n",
      "    Insert key with a value of default if key is not in the dictionary.\n",
      "    \n",
      "    Return the value for key if key is in the dictionary, else default.\n",
      "\n",
      "Provid a word to search for vowels: an apple\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'a': 2, 'e': 1}"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.setdefault == > 初始化字典 【特定】 的值\n",
    "help(stu_info.setdefault)\n",
    "stu_info1 = {\n",
    "    \"stu2001\" : \"123123\"\n",
    "}\n",
    "stu_info1.setdefault(\"stu2002\",\"101010\")\n",
    "stu_info1\n",
    "\n",
    "#字典的进阶方法：初始化特定的值 setdefault()\n",
    "\n",
    "\n",
    "vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n",
    "word = input(\"Provid a word to search for vowels: \")\n",
    "found = {}\n",
    "\n",
    "for i in word:\n",
    "    if i in vowels:\n",
    "        found.setdefault(i,0) # 特定情况下（字典中不存在该元素时，初始化其值）\n",
    "        found[i] +=1\n",
    "found\n",
    "# 查询 key 是否出现在字典当中\n",
    "# 出现过，就当没看见，不做任何操作\n",
    "# key 未出现过，给定key及value(指定的初始化的值)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "3fa69379",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function update:\n",
      "\n",
      "update(...) method of builtins.dict instance\n",
      "    D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.\n",
      "    If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]\n",
      "    If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v\n",
      "    In either case, this is followed by: for k in F:  D[k] = F[k]\n",
      "\n",
      "{'Name': 'LiHua', 'Age': '21', 'Job': 'student'}\n"
     ]
    }
   ],
   "source": [
    "# D.update ==> 字典数据的 更新字典参数 dict2 的 key/value(键/值) 对更新到字典 dict 里。【重复出现的键也会由新的键覆盖旧的键】\n",
    "help(stu_info.update)\n",
    "\n",
    "dict = {\n",
    "    \"Name\" : \"LiHua\",\n",
    "    \"Age\" : \"20\"\n",
    "}\n",
    "dict2 = {\n",
    "    \"Job\" : \"student\",\n",
    "    \"Age\" : \"21\"\n",
    "}\n",
    "\n",
    "dict.update(dict2)\n",
    "print(dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "8cb0f1bd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function values:\n",
      "\n",
      "values(...) method of builtins.dict instance\n",
      "    D.values() -> an object providing a view on D's values\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['123123', '101010']"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# D.values ==> 以 列表 的形式取出字典的值\n",
    "help(stu_info.values)\n",
    "\n",
    "list(stu_info1.values())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "697922b2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "80d03e90",
   "metadata": {},
   "source": [
    "### Work1.3"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d6783af",
   "metadata": {},
   "source": [
    "字典的使用方法 | 注意事项 | 使用结果\n",
    ":---|:---: | ---:\n",
    "pop()    | 给定一个存在的key，可以进行对应成员(key及value)的删除 | D.pop(k[,d]) -> v\n",
    "popitem() | 可以不给 key 起到任意删除的作用 | D.popitem() -> v\n",
    "clear() | 清空字典的所有数据 | D.clear() -> {}\n",
    "copy() | 对字典进行浅复制 | D1 = D.copy()\n",
    "fromkeys() | 初始化所有字典的值 | D.fromkeys(iterable,v)\n",
    "setdefault() | 初始化字典的特定的值 | D。setdefault(k,v)\n",
    "get() | 查询字典的值，不存在的键值 返回 NONE | D.get(k) -> v\n",
    "items() | 循环遍历字典，方便对字典进行统一的操作 | D.items()\n",
    "keys() | 以列表的形式取出字典的键 | list(D.keys())\n",
    "values() | 以列表的形式取出字典的值 | list(D.values())\n",
    "update() | 字典参数 dict2 的 key/value 对更新到字典 dict 里 | D.update(D1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1c8d257e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "91007e68",
   "metadata": {},
   "source": [
    "## Work2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "27b82f51",
   "metadata": {},
   "source": [
    "> 1. 请找出id为'BOHGD588HJ'的信息（第一题如上）\n",
    "> 2. 请找出所有的 pois 中的字典元素的 id,存到一个id列表中\n",
    "> 3. 请找出所有的 pois 中的字典元素的 name，存到一个 id 列表中\n",
    "> 4. 请找出所有的 name 以及 location 做一个字典（name_dict = {name1:location1,name2:location2,...}）\n",
    "> 5. 请找出所有含有 \"tel\" 的元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "86533933",
   "metadata": {},
   "outputs": [],
   "source": [
    "广州南方学院 = {'status': '1',\n",
    " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
    "    'location': '113.678,23.6284',\n",
    "    'direction': '北',\n",
    "    'name': '博学路',\n",
    "    'distance': '7.63232'},\n",
    "   {'id': '020F49F0050462229',\n",
    "    'location': '113.679,23.6245',\n",
    "    'direction': '北',\n",
    "    'name': '老虎形街',\n",
    "    'distance': '445.159'},\n",
    "   {'id': '020F49F0050462451',\n",
    "    'location': '113.677,23.6347',\n",
    "    'direction': '南',\n",
    "    'name': '中山路',\n",
    "    'distance': '708.299'}],\n",
    "  'roadinters': [{'second_name': '中山路',\n",
    "    'first_id': '020F49F0050461206',\n",
    "    'second_id': '020F49F0050462451',\n",
    "    'location': '113.676794,23.634661',\n",
    "    'distance': '708.299',\n",
    "    'first_name': '博学路',\n",
    "    'direction': '南'}],\n",
    "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
    "  'addressComponent': {'city': '广州市',\n",
    "   'province': '广东省',\n",
    "   'adcode': '440117',\n",
    "   'district': '从化区',\n",
    "   'towncode': '440117100000',\n",
    "   'streetNumber': {'number': '24号',\n",
    "    'location': '113.677267,23.629149',\n",
    "    'direction': '西北',\n",
    "    'distance': '129.943',\n",
    "    'street': '博学路'},\n",
    "   'country': '中国',\n",
    "   'township': '温泉镇',\n",
    "   'businessAreas': [[]],\n",
    "   'building': {'name': [], 'type': []},\n",
    "   'neighborhood': {'name': [], 'type': []},\n",
    "   'citycode': '020'},\n",
    "  'aois': [],\n",
    "  'pois': [{'id': 'B0FFG4TAF2',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
    "    'poiweight': '0.237309',\n",
    "    'name': '广州南方公寓',\n",
    "    'location': '113.678983,23.627778',\n",
    "    'distance': '102.617',\n",
    "    'tel': '13622768437',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0H6FA18J5',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院南侧)',\n",
    "    'poiweight': '0.223065',\n",
    "    'name': '保利半山花园',\n",
    "    'location': '113.679358,23.627672',\n",
    "    'distance': '139.054',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅区'},\n",
    "   {'id': 'B00140TWHT',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '笃行路2',\n",
    "    'poiweight': '0.157653',\n",
    "    'name': '教工住宅1号',\n",
    "    'location': '113.678490,23.630432',\n",
    "    'distance': '222.658',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0FFHRJDM9',\n",
    "    'direction': '东南',\n",
    "    'businessarea': [],\n",
    "    'address': '中大南方学院南门1号',\n",
    "    'poiweight': '0.256152',\n",
    "    'name': '中南公寓',\n",
    "    'location': '113.680349,23.627573',\n",
    "    'distance': '231.723',\n",
    "    'tel': '13711245345',\n",
    "    'type': '商务住宅;住宅区;住宅小区'},\n",
    "   {'id': 'B0HGD588HJ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼4号',\n",
    "    'location': '113.677460,23.630490',\n",
    "    'distance': '242.901',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFHZH0IK',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路广州南方学院综合楼内',\n",
    "    'poiweight': '0.17934',\n",
    "    'name': '地下铁',\n",
    "    'location': '113.677941,23.629029',\n",
    "    'distance': '74.1376',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
    "   {'id': 'B0HGDU76L2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院2号实验楼',\n",
    "    'location': '113.678211,23.630956',\n",
    "    'distance': '280.003',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP838K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路25',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼3号(外国语学院)',\n",
    "    'location': '113.677247,23.630947',\n",
    "    'distance': '298.093',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU8NLD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院1号实验楼',\n",
    "    'location': '113.678215,23.631370',\n",
    "    'distance': '326.007',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD58UTU',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院2号教学楼',\n",
    "    'location': '113.677060,23.631346',\n",
    "    'distance': '346.352',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B00140MR9A',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号',\n",
    "    'poiweight': '0.450402',\n",
    "    'name': '广州南方学院',\n",
    "    'location': '113.679262,23.632583',\n",
    "    'distance': '471.564',\n",
    "    'tel': '020-87828988;020-61787331',\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU92JD',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': [],\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼1号',\n",
    "    'location': '113.677077,23.631783',\n",
    "    'distance': '391.548',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD592BJ',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道886号广州南方学院内',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院综合楼',\n",
    "    'location': '113.680117,23.631544',\n",
    "    'distance': '392.731',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFKP81F0',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路19号附近',\n",
    "    'poiweight': '0.191742',\n",
    "    'name': '教学楼1号(文学与传媒学院)',\n",
    "    'location': '113.676866,23.631736',\n",
    "    'distance': '393.93',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFLBEOND',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.190963',\n",
    "    'name': '聚贤楼10号',\n",
    "    'location': '113.681253,23.631036',\n",
    "    'distance': '418.51',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0FFH6K3U9',\n",
    "    'direction': '西北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
    "    'poiweight': '0.254885',\n",
    "    'name': '广州中大南方招待所',\n",
    "    'location': '113.676330,23.631332',\n",
    "    'distance': '378.102',\n",
    "    'tel': '020-61787222',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGD58NF8',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院达人书院',\n",
    "    'location': '113.679041,23.632392',\n",
    "    'distance': '446.366',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0FFKUVYWV',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '保利桃花源',\n",
    "    'poiweight': '0.273168',\n",
    "    'name': '广州和风庭阿七度假别墅',\n",
    "    'location': '113.681736,23.630569',\n",
    "    'distance': '424.35',\n",
    "    'tel': '18681565305',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0HGDU99RM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内',\n",
    "    'poiweight': '0.257947',\n",
    "    'name': '广州南方学院图书馆',\n",
    "    'location': '113.679177,23.632762',\n",
    "    'distance': '489.331',\n",
    "    'tel': '020-61787368;020-61787371',\n",
    "    'type': '科教文化服务;图书馆;图书馆'},\n",
    "   {'id': 'B0HGDU92JC',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路附近',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院4号实验楼',\n",
    "    'location': '113.679963,23.632652',\n",
    "    'distance': '498.883',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0FFL7C054',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
    "    'poiweight': '0.317505',\n",
    "    'name': '广州U优森特酒店',\n",
    "    'location': '113.679226,23.632528',\n",
    "    'distance': '464.819',\n",
    "    'tel': '15813395296',\n",
    "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
    "   {'id': 'B0FFG8CSEK',\n",
    "    'direction': '东北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.185371',\n",
    "    'name': 'L5员工宿舍',\n",
    "    'location': '113.682583,23.631487',\n",
    "    'distance': '554.129',\n",
    "    'tel': [],\n",
    "    'type': '商务住宅;住宅区;宿舍'},\n",
    "   {'id': 'B0HGD58FR2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼9号',\n",
    "    'location': '113.679747,23.633032',\n",
    "    'distance': '532.163',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HG5Z9JNK',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路',\n",
    "    'poiweight': '0.221553',\n",
    "    'name': '广州南方学院教学楼7号',\n",
    "    'location': '113.678600,23.633330',\n",
    "    'distance': '544.868',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD599JM',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院第11教学楼',\n",
    "    'location': '113.680037,23.633173',\n",
    "    'distance': '556.036',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0GUJYPEG2',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
    "    'poiweight': '0.216026',\n",
    "    'name': '怒烤烤串(从化店)',\n",
    "    'location': '113.677160,23.632910',\n",
    "    'distance': '510.112',\n",
    "    'tel': [],\n",
    "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
    "   {'id': 'B0HGDU6Z41',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '温泉大道882',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼6号',\n",
    "    'location': '113.678424,23.633710',\n",
    "    'distance': '586.331',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'},\n",
    "   {'id': 'B0HGD580NZ',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '博学路7号附近',\n",
    "    'poiweight': '0.285712',\n",
    "    'name': '广州南方学院惟贤门',\n",
    "    'location': '113.678437,23.633721',\n",
    "    'distance': '587.601',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;高等院校'},\n",
    "   {'id': 'B0HGDU7T1K',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '从莞深高速(广州南方学院)',\n",
    "    'poiweight': '0.191229',\n",
    "    'name': '广州南方学院教学楼10号',\n",
    "    'location': '113.680125,23.633492',\n",
    "    'distance': '592.504',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
    "   {'id': 'B0HGDU76L1',\n",
    "    'direction': '北',\n",
    "    'businessarea': [],\n",
    "    'address': '中山路与博学路交叉口东南150米',\n",
    "    'poiweight': '0.221662',\n",
    "    'name': '广州南方学院教学楼5号',\n",
    "    'location': '113.678046,23.633982',\n",
    "    'distance': '616.848',\n",
    "    'tel': [],\n",
    "    'type': '科教文化服务;学校;学校'}]},\n",
    " 'info': 'OK',\n",
    " 'infocode': '10000'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c2a519c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461206',\n",
       "    'location': '113.678,23.6284',\n",
       "    'direction': '北',\n",
       "    'name': '博学路',\n",
       "    'distance': '7.63232'},\n",
       "   {'id': '020F49F0050462229',\n",
       "    'location': '113.679,23.6245',\n",
       "    'direction': '北',\n",
       "    'name': '老虎形街',\n",
       "    'distance': '445.159'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '南',\n",
       "    'name': '中山路',\n",
       "    'distance': '708.299'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '708.299',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇博学路',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117100000',\n",
       "   'streetNumber': {'number': '24号',\n",
       "    'location': '113.677267,23.629149',\n",
       "    'direction': '西北',\n",
       "    'distance': '129.943',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [],\n",
       "  'pois': [{'id': 'B0FFG4TAF2',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇乌土村松浪队5号(近博学路)',\n",
       "    'poiweight': '0.237309',\n",
       "    'name': '广州南方公寓',\n",
       "    'location': '113.678983,23.627778',\n",
       "    'distance': '102.617',\n",
       "    'tel': '13622768437',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0H6FA18J5',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院南侧)',\n",
       "    'poiweight': '0.223065',\n",
       "    'name': '保利半山花园',\n",
       "    'location': '113.679358,23.627672',\n",
       "    'distance': '139.054',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅区'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '222.658',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFHRJDM9',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '中大南方学院南门1号',\n",
       "    'poiweight': '0.256152',\n",
       "    'name': '中南公寓',\n",
       "    'location': '113.680349,23.627573',\n",
       "    'distance': '231.723',\n",
       "    'tel': '13711245345',\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '242.901',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFHZH0IK',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路广州南方学院综合楼内',\n",
       "    'poiweight': '0.17934',\n",
       "    'name': '地下铁',\n",
       "    'location': '113.677941,23.629029',\n",
       "    'distance': '74.1376',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;冷饮店;冷饮店'},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '280.003',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '298.093',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '326.007',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '346.352',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00140MR9A',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '广州南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '471.564',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '391.548',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '392.731',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '393.93',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '418.51',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号广州南方学院H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '378.102',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'distance': '446.366',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKUVYWV',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '保利桃花源',\n",
       "    'poiweight': '0.273168',\n",
       "    'name': '广州和风庭阿七度假别墅',\n",
       "    'location': '113.681736,23.630569',\n",
       "    'distance': '424.35',\n",
       "    'tel': '18681565305',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '489.331',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '498.883',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'distance': '464.819',\n",
       "    'tel': '15813395296',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '554.129',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'distance': '532.163',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '544.868',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '556.036',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'distance': '510.112',\n",
       "    'tel': [],\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅'},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '586.331',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '587.601',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0HGDU7T1K',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.191229',\n",
       "    'name': '广州南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '592.504',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0HGDU76L1',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南150米',\n",
       "    'poiweight': '0.221662',\n",
       "    'name': '广州南方学院教学楼5号',\n",
       "    'location': '113.678046,23.633982',\n",
       "    'distance': '616.848',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f91a2ab9",
   "metadata": {},
   "source": [
    "### Work2.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "790a3645",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['status', 'regeocode', 'info', 'infocode'])"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "id": "b2ef2a7a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['roads', 'roadinters', 'formatted_address', 'addressComponent', 'aois', 'pois'])"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode'].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "d0120c82",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'id': 'B0HGD588HJ', 'direction': '北', 'businessarea': [], 'address': '博学路', 'poiweight': '0.221662', 'name': '广州南方学院教学楼4号', 'location': '113.677460,23.630490', 'distance': '242.901', 'tel': [], 'type': '科教文化服务;学校;学校'}\n"
     ]
    }
   ],
   "source": [
    "pois_list = 广州南方学院['regeocode']['pois']\n",
    "for i in pois_list:\n",
    "    if i[\"id\"] == 'B0HGD588HJ':\n",
    "        print(i)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b19f72a3",
   "metadata": {},
   "source": [
    "### Work2.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "bb8006d7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['B0FFG4TAF2', 'B0H6FA18J5', 'B00140TWHT', 'B0FFHRJDM9', 'B0HGD588HJ', 'B0FFHZH0IK', 'B0HGDU76L2', 'B0FFKP838K', 'B0HGDU8NLD', 'B0HGD58UTU', 'B00140MR9A', 'B0HGDU92JD', 'B0HGD592BJ', 'B0FFKP81F0', 'B0FFLBEOND', 'B0FFH6K3U9', 'B0HGD58NF8', 'B0FFKUVYWV', 'B0HGDU99RM', 'B0HGDU92JC', 'B0FFL7C054', 'B0FFG8CSEK', 'B0HGD58FR2', 'B0HG5Z9JNK', 'B0HGD599JM', 'B0GUJYPEG2', 'B0HGDU6Z41', 'B0HGD580NZ', 'B0HGDU7T1K', 'B0HGDU76L1']\n"
     ]
    }
   ],
   "source": [
    "pois_id_1 = [ ]\n",
    "for j in pois_list:\n",
    "    pois_id_1.append(j['id'])\n",
    "print(pois_id_1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ecc1e364",
   "metadata": {},
   "source": [
    "### Work2.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "id": "7797634c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['广州南方公寓', '保利半山花园', '教工住宅1号', '中南公寓', '广州南方学院教学楼4号', '地下铁', '广州南方学院2号实验楼', '教学楼3号(外国语学院)', '广州南方学院1号实验楼', '广州南方学院2号教学楼', '广州南方学院', '广州南方学院教学楼1号', '广州南方学院综合楼', '教学楼1号(文学与传媒学院)', '聚贤楼10号', '广州中大南方招待所', '广州南方学院达人书院', '广州和风庭阿七度假别墅', '广州南方学院图书馆', '广州南方学院4号实验楼', '广州U优森特酒店', 'L5员工宿舍', '广州南方学院教学楼9号', '广州南方学院教学楼7号', '广州南方学院第11教学楼', '怒烤烤串(从化店)', '广州南方学院教学楼6号', '广州南方学院惟贤门', '广州南方学院教学楼10号', '广州南方学院教学楼5号']\n"
     ]
    }
   ],
   "source": [
    "pois_id_2 = [ ]\n",
    "for q in pois_list:\n",
    "    pois_id_2.append(q['name'])\n",
    "print(pois_id_2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be7ae629",
   "metadata": {},
   "source": [
    "### Work2.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "1c990b54",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['status', 'regeocode', 'info', 'infocode'])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "8683160e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['roads', 'roadinters', 'formatted_address', 'addressComponent', 'aois', 'pois'])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院['regeocode'].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "25602350",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'广州南方公寓': '113.678983,23.627778', '保利半山花园': '113.679358,23.627672', '教工住宅1号': '113.678490,23.630432', '中南公寓': '113.680349,23.627573', '广州南方学院教学楼4号': '113.677460,23.630490', '地下铁': '113.677941,23.629029', '广州南方学院2号实验楼': '113.678211,23.630956', '教学楼3号(外国语学院)': '113.677247,23.630947', '广州南方学院1号实验楼': '113.678215,23.631370', '广州南方学院2号教学楼': '113.677060,23.631346', '广州南方学院': '113.679262,23.632583', '广州南方学院教学楼1号': '113.677077,23.631783', '广州南方学院综合楼': '113.680117,23.631544', '教学楼1号(文学与传媒学院)': '113.676866,23.631736', '聚贤楼10号': '113.681253,23.631036', '广州中大南方招待所': '113.676330,23.631332', '广州南方学院达人书院': '113.679041,23.632392', '广州和风庭阿七度假别墅': '113.681736,23.630569', '广州南方学院图书馆': '113.679177,23.632762', '广州南方学院4号实验楼': '113.679963,23.632652', '广州U优森特酒店': '113.679226,23.632528', 'L5员工宿舍': '113.682583,23.631487', '广州南方学院教学楼9号': '113.679747,23.633032', '广州南方学院教学楼7号': '113.678600,23.633330', '广州南方学院第11教学楼': '113.680037,23.633173', '怒烤烤串(从化店)': '113.677160,23.632910', '广州南方学院教学楼6号': '113.678424,23.633710', '广州南方学院惟贤门': '113.678437,23.633721', '广州南方学院教学楼10号': '113.680125,23.633492', '广州南方学院教学楼5号': '113.678046,23.633982'}\n"
     ]
    }
   ],
   "source": [
    "name_dict = { }\n",
    "for w in 广州南方学院['regeocode']['pois']:\n",
    "    name_dict[w[\"name\"]]=w[\"location\"]\n",
    "print(name_dict)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b164379",
   "metadata": {},
   "source": [
    "### Work2.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a30f765b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['13622768437', '13711245345', '020-87828988;020-61787331', '020-61787222', '18681565305', '020-61787368;020-61787371', '15813395296']\n"
     ]
    }
   ],
   "source": [
    "pois_tel = [ ]\n",
    "for e in 广州南方学院['regeocode']['pois']:\n",
    "    if e['tel'] == [] :\n",
    "        continue\n",
    "    else:\n",
    "        pois_tel.append(e['tel'])\n",
    "print(pois_tel)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "834da18b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "30f43350",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
